<tagLib name="cx,html" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>YBlog后台管理</title>
<style>
.xboxcontent {
background:#F5F9FD none repeat scroll 0 0;
border-color:#C4DAFF;
border-style:solid;
border-width:0 1px;
display:block;
}
.login {
background:transparent none repeat scroll 0 0;
color:#2B3C60;
margin: auto auto;
margin-top:50px;
width:272px;
}
.login h2, .login p {
letter-spacing:1px;
margin:0 15px;
}
.login h2 {
border:0 none;
color:#0086E3;
font-size:14px;
line-height:36px;
}
.login p {
color:#787D86;
padding-bottom:0.1em;
}
.login h2 {
padding-top:13px;
}
.xtop, .xbottom {
background:transparent none repeat scroll 0 0;
display:block;
font-size:1px;
}
.xb1, .xb2, .xb3, .xb4 {
display:block;
overflow:hidden;
}
.xb1, .xb2, .xb3 {
height:1px;
}
.xb2, .xb3, .xb4 {
background:#F5F9FD none repeat scroll 0 0;
border-left:1px solid #C4DAFF;
border-right:1px solid #C4DAFF;
}
.xb1 {
background:#C4DAFF none repeat scroll 0 0;
margin:0 5px;
}
.xb2 {
border-width:0 2px;
margin:0 3px;
}
.xb3 {
margin:0 2px;
}
.xb4 {
height:2px;
margin:0 1px;
}
.login table {
font-size:14px;
margin:0 auto;
}
.login td {
line-height:44px;
}
.login .name {
border:1px solid #CDCDCD;
height:26px;
line-height:26px;
width:180px;
}
.login span {
font-size:12px;
}
</style>
<script language='javaScript' src='__PUBLIC__/Js/jquery.js'></script> 
<script type="text/javascript" src="__PUBLIC__/Js/jquery.form.js"></script>
<script language="javascript">
function prepareLogin()
{
	$("#result").html('<img src="__PUBLIC__/Images/loading.gif" /> 正在登录');
}

function processResponse(data)
{
	if(data.status == 1)
	{
		$("#result").html('<img src="__PUBLIC__/Images/ok.gif" /> '+data.info);
		window.location = '{$goto}';
	}
	else
	{
		$("#result").html('<img src="__PUBLIC__/Images/error.gif" /><font color="red"> '+data.info+'</font>');
		$("#result").fadeOut(3000);
		window.setTimeout(function(){ $("#result").hide(); },3000);
	}
}

$(document).ready(function() { 
    var options = { 
		beforeSubmit: prepareLogin,
        success: processResponse,
		dataType: 'json'
    }; 

    $('#loginForm').ajaxForm(options);
});

function fleshVerify(){ //重载验证码
	var timenow = new Date().getTime();
	$('#verifyImg').attr("src","{:url('verify','Public','',APP_NAME,array('h'=>'1','ts'=>'"+timenow+"'))}");
}
</script>
</head>

<body onload="document.login.username.focus()" >
<div class="login r" align="center">
	<b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b>
	<div class="xboxcontent">
		<h2>YBlog后台管理</h2>
		<p id="result"></p>
	   <form method="POST" name="login" id="loginForm" action="{:url('checkLogin')}">
		<table width="90%" border="0">
		  <tr>
			<td width="20%" align="right">用户名</td>
			<td><input name="username" type="text" tabindex="1" value="" ></td>
		  </tr>
		  <tr>
			<td align="right">密　码</td>
			<td><input name="password" type="password" tabindex="2"/></td>
		  </tr>
		  <tr>
			<td align="right">验证码</td>
			<td>
			<input type="text" style="width: 95px" tabindex="3" name="verify">&nbsp;<img id="verifyImg" src="{:url('verify','Public','',APP_NAME,array('h'=>'1'))}" border="0" alt="点击刷新验证码" align="absmiddle" onclick="fleshVerify()">
			</td>
		  </tr>					  
		  <tr>
			<td colspan="2" align="center"><input type="hidden" name="ajax" value="1"><input type="image" name="submit" src="../Public/Images/button_login.gif" /></td>
		  </tr>
		</table>
		</form>
	<p>&nbsp;</p>
	</div>
	<b class="xbottom"><b class="xb4"></b><b class="xb3"></b><b class="xb2"></b><b class="xb1"></b></b>
</div>
</body>
</html>